<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>我的好友</title>
    <link rel="stylesheet" type="text/css" th:href="@{/layui/css/layui.css}">
    <!--semantic-ui-->
    <link th:href="@{/css/semantic.min.css}" rel="stylesheet">
    <script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>
    <script type="text/javascript" th:src="@{/layer/layer.js}"></script>
    <script type="text/javascript" th:src="@{/layui/layui.js}"></script>

</head>
<body>
<!--菜单-->
<ul class="layui-nav layui-bg-blue" lay-filter="">
    <li class="layui-nav-item "><a href="/" style="font-size: 20px">首页</a></li>
    <li class="layui-nav-item">
        <a href="javascript:;" style="font-size: 20px">习题库</a>
        <dl class="layui-nav-child"> <!-- 二级菜单 -->
            <dd>
                <a th:href="@{/item/chapter/overview}">分章节练习</a>
            </dd>
            <dd>
                <a th:href="@{/item/overview}">分题型练习</a>
            </dd>
        </dl>
    </li>
    <li class="layui-nav-item">
        <a href="javascript:;" style="font-size: 20px">课程分类</a>
        <dl class="layui-nav-child"> <!-- 二级菜单 -->
            <dd>
                <a th:href="@{'/course/type_show/'+${coursetype.getId()}}" th:each="coursetype:${coursetypes}" th:text="${coursetype.getCourse_name()}"></a>
            </dd>
            <dd>
                <a th:href="@{/course/type_show/0}" >全部课程</a>
            </dd>
        </dl>
    </li>
    <li class="layui-nav-item" th:if="${session.loginuser} == null"><a th:href="@{/community/index}" style="font-size: 20px">社区</a></li>
    <li class="layui-nav-item " th:if="${session.loginuser} != null">
        <a href="javascript:;" style="font-size: 20px">社区</a>
        <dl class="layui-nav-child">
            <dd><a th:href="@{/community/index}">社区首页</a></dd>
            <dd><a th:href="@{/stu/community/commenting}">发布话题</a></dd>
            <dd><a th:href="@{/stu/community/management}">我的话题</a></dd>
            <dd><a th:href="@{/stu/chat_all}" target="_blank">头脑风暴</a></dd>
        </dl>
    </li>
    <li class="layui-nav-item"><a th:href="@{/file/list}" style="font-size: 20px">资料干货</a></li>

    <!--如果没有登录-->
    <li class="layui-nav-item" th:if="${session.loginuser} == null">
        <a th:href="@{/login}" style="font-size: 20px">登录</a>
    </li>
    <li class="layui-nav-item" th:if="${session.loginuser} == null">
        <a th:href="@{/register}" style="font-size: 20px">注册</a>
    </li>
    <!--如果没有登录-->

    <!--如果登录-->
    <li class="layui-nav-item" th:if="${session.loginuser} != null">
        <a href="javascript:;" style="font-size: 20px">我的班级</a>
        <dl class="layui-nav-child"> <!-- 二级菜单 -->
            <dd>
                <a th:href="@{/stu/map/show}">班级签到</a>
            </dd>
            <dd>
                <a th:href="@{/stu/exam/overview}">班级考试</a>
            </dd>
            <dd>
                <a th:href="@{/stu/exam/mydegree/list}">我的考试成绩</a>
            </dd>
        </dl>
    </li>
    <li class="layui-nav-item layui-this" th:if="${session.loginuser} != null">
        <a href="javascript:;" style="font-size: 20px">好友管理</a>
        <dl class="layui-nav-child"> <!-- 二级菜单 -->
            <dd>
                <a th:href="@{/stu/friends/list}">好友列表</a>
            </dd>
            <dd>
                <a th:href="@{/stu/friends/search}">搜索好友</a>
            </dd>
        </dl>
    </li>
    <li class="layui-nav-item" th:if="${session.loginuser} != null">
        <img th:src="@{'/show/'+${session.loginuser.getId()}}" class="layui-nav-img">[[${session.loginuser.username}]]
        <dl class="layui-nav-child">
            <dd><a th:href="@{/stu/center}">个人中心</a></dd>
            <dd><a th:href="@{/stu/logout}">退出</a></dd>
        </dl>
    </li>

    <!--如果登录-->
</ul>
<!--菜单-->
<br>


<br>
<!--查看聊天信息-->
<ul class="layui-fixbar">
    <li id="messages_list" class="layui-icon layui-icon-reply-fill" style="background-color: rgb(0, 150, 136); display: list-item;"></li>
</ul>
<!--查看聊天信息-->
<div class="ui container" >
    <div class="ui segment">
        <div class="ui feed">

            <div class="event" th:each="user:${friends}">
                <div class="label">
                    <img th:src="@{'/show/'+${user.getHis_id()}}">
                </div>
                <div class="content">
                    <div class="summary">
                        <a class="user">
                            [[${user.getHis_name()}]]
                        </a>
                    </div>
                    <div class="meta" >
                        <a class="like" th:href="@{'/stu/chat_one/'+${user.getHis_id()}}" target="_blank">
                            <i class="comment icon"></i> 聊天
                        </a>
                        <a class="like" th:href="@{'/stu/message/'+${user.getHis_id()}}" target="_blank">
                            <i class="paint brush icon"></i> 留言
                        </a>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
<script>

    //注意：导航 依赖 element 模块，否则无法进行功能性操作
    layui.use('element', function(){
        var element = layui.element;

        //…
    });

    $(document).ready(function () {
        //边缘弹出
        layer.open({
            type: 2,
            title: '好友留言',
            offset: 'r', //具体配置参考：offset参数项
            // maxmin: true,
            shadeClose: true, //点击遮罩关闭层
            shade: 0,
            area : ['300px' , '520px'],
            content: '/stu/message/all_friends/list'
        });

        $('#messages_list').click(function () {
            //边缘弹出
            layer.open({
                type: 2,
                title: '好友留言',
                offset: 'r', //具体配置参考：offset参数项
                // maxmin: true,
                shadeClose: true, //点击遮罩关闭层
                shade: 0,
                area : ['300px' , '520px'],
                content: '/stu/message/all_friends/list'
            });
        });
    })

</script>
</html>